<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>JSF 2.0 Hello World</title>
</h:head>
<h:body>
	<h:form id="form">  
		<h1>bienvenido</h1>
		#{buscarSujeto.user.userName}
		<p:panelGrid style="withd=100%">  
		    <f:facet name="header">  
		        <p:row>  
		            <p:column colspan="3">Buscar Sujeto</p:column>  
		        </p:row>  
		    </f:facet>  
		  
		    <p:row>  
		        <p:column>
	  				<p:selectOneRadio id="options" value="#{buscarSujeto.tipoDeBusqueda}">  
			            <f:selectItem itemLabel="Numero de Cliente" itemValue="NumeroCliente" />  
			            <f:selectItem itemLabel="Apellido" itemValue="Apellido" />  
			            <f:selectItem itemLabel="Razon Social" itemValue="RazonSocial"/>  
			        </p:selectOneRadio>
	  			</p:column>
	  			<p:column><p:inputText /> </p:column>
	  			<p:column><p:commandButton id="cmdBuscar" icon="ui-icon-search" action="#{buscarSujeto.buscarPorCriterio}"  /> </p:column>
		    </p:row>  
		</p:panelGrid>  
    	<br></br>
    	<p:dataTable id="cars" var="car" value="#{tableBean.carsSmall}"
    		emptyMessage="No se encontro ningun Sujeto">
    		  
  			<f:facet name ="header">
  				Sujetos Encontrados
  			</f:facet>
	        <p:column headerText="Model" style="width:24%">  
	            <h:outputText value="#{car.model}" />  
	        </p:column>  
	  
	        <p:column headerText="Year" style="width:24%">  
	            <h:outputText value="#{car.year}" />  
	        </p:column>  
	  
	        <p:column headerText="Manufacturer" style="width:24%">  
	            <h:outputText value="#{car.manufacturer}" />  
	        </p:column>  
	  
	        <p:column headerText="Color" style="width:24%">  
	            <h:outputText value="#{car.color}" />  
	        </p:column>  
	  
	        <p:column style="width:4%">  
	                <p:commandButton id="selectButton" update=":form:display" oncomplete="carDialog.show()" icon="ui-icon-search" title="View">  
	                <f:setPropertyActionListener value="#{car}" target="#{tableBean.selectedCar}" />  
	            </p:commandButton>  
	        </p:column>  
  
    </p:dataTable>  
  
</h:form>  
</h:body>
</html>